import axios from 'axios'

const url = '/api/supervisord'

export const SupervisordApi = {
  /**
     *
     * @param {String} instance 实例名
     * @param {Number} pageNo 当前页
     * @param {Number} pageSize 页大小
     */
  getData(instance, pageNo, pageSize) {
    return axios.get(`${url}/${instance}/${pageNo}/${pageSize}`)
  },

  status(instance, processName, action) {
    return axios.post(`${url}/${instance}/${processName}/${action}`)
  },

  jobAction(instance, action) {
    return axios.post(`${url}/${instance}/job/${action}`)
  },

  editJob(instance, jobId, data) {
    return axios.put(`${url}/${instance}/${jobId}`, data)
  }
}
